import 'package:ai_data_capture/req/network_service.dart';
import 'package:ai_data_capture/util/catch_util.dart';

class UserApi {
  static login(String account, String password) async {
    var res = await NetworkService.post(url: "user/login", map: {
      "account": account,
      "password": password,
    });
    await CacheUtil.saveToken("${res?.data ?? ''}");
  }

  static register(String account, String password) async {
    var res = await NetworkService.post(url: "user/register", map: {
      "account": account,
      "password": password,
    });
    await CacheUtil.saveToken("${res?.data ?? ''}");
  }
}
